import request from '@/utils/request_ry.js'
import config from "@/config";

export function getList(data) {
	return request({
		'url': '/exam/api/exam/exam/online-paging',
		'method': 'post',
		'data': data
	})
}

export function checkProcess() {
	return request({
		'url': '/exam/api/paper/paper/check-process',
		'method': 'post',
	})
}

/**
 * 试卷详情
 * @param data
 */
export function paperResult(data) {
	return request({
		'url': '/exam/api/paper/paper/paper-result',
		'method': 'post',
		'data': data
	})
}

/**
 * {"examId":"1882704715109335042","password":""}
 */
export function createPaper(data) {
	return request({
		'url': '/exam/api/paper/paper/create-paper',
		'method': 'post',
		'data': data
	})
}

/**
 * @param {Object} data
 * {id: "1883329261566939137"}
 */
export function paperDetail(data) {
	return request({
		'url': '/exam/api/paper/paper/paper-detail',
		'method': 'post',
		'data': data
	})
}

/**
 * {"paperId":"1883329261566939137","quId":"1587622642263625729"}
 * @param {Object} data
 */
export function quDetail(data) {
	return request({
		'url': '/exam/api/paper/paper/qu-detail',
		'method': 'post',
		'data': data
	})
}

/**
 * @param {Object} data
 * {"paperId":"1883329261566939137","quId":"1587622642263625729","answers":["00fe27f3-e10f-4da7-876f-6c6ce7a570da"],"answer":""}
 */
export function fillAnswer(data) {
	return request({
		'url': '/exam/api/paper/paper/fill-answer',
		'method': 'post',
		'data': data
	})
}

export function handExam(data) {
	return request({
		'url': '/exam/api/paper/paper/hand-exam',
		'method': 'post',
		'data': data
	})
}

export function myPaging(data) {
	return request({
		'url': '/exam/api/user/exam/my-paging',
		'method': 'post',
		'data': data
	})
}

export function wrongBook(data) {
	return request({
		'url': '/exam/api/user/wrong-book/paging',
		'method': 'post',
		'data': data
	})
}
export function wrongBookDetail(data) {
	return request({
		'url': '/exam/api/qu/qu/detail',
		'method': 'post',
		'data': data
	})
}

export function paging(data) {
	return request({
		'url': '/exam/api/paper/paper/paging',
		'method': 'post',
		'data': data
	})
}

export function selectDura(data) {
	return request({
		'url': '/exam/api/exam/exam/selectDura',
		'method': 'post',
		'data': data
	})
}

export function downPdf(data) {
	return config.baseUrl + '/jy/jyPDF/down?id=' + data.baseId + '&typeName='+data.typeName+'&zyqdId='+data.id;
}


export function erweimaUrl(data) {
	return config.erweimaUrl+'/jy/jyPDF/down?id=' + data.baseId + '&typeName='+data.typeName+'&zyqdId='+data.id;
}
